Previous Book Contents Book Index Next

Inside Macintosh: Mac OS 8 Toolbox Reference /
Chapter 2 - Control Manager Reference / Control Manager Functions
Embedding Controls /


CreateRootControl

NEW WITH THE APPEARANCE MANAGER

Creates the root control for a specified window.

pascal OSErr CreateRootControl (
                     WindowPtr inWindow,
                     ControlHandle* outControl);
inWindow
On input, a pointer to the window in which you wish to create a root control.
outControl
On output, a pointer to a handle to the root control.
function result
A result code; see "Result Codes". The result code errControlsAlreadyExist indicates that other controls were already present when CreateRootControl was called. The result code errRootAlreadyExists indicates that a root control was already created for the window.
DISCUSSION
The CreateRootControl function creates the root control for a window if no other controls are present. If there are any controls in the window prior to calling CreateRootControl, an error is returned and the root control is not created.

The root control acts as the top-level container for a window and is required for embedding to occur. Once the root control is created, you can call EmbedControl and AutoEmbedControl to embed controls in the root control.

Note
The minimum, maximum, and initial settings for a root control are reserved and should not be changed.
SEE ALSO
"Embedding Controls".

"Appearance Manager Gestalt Selector Constants".


Previous Book Contents Book Index Next

© Apple Computer, Inc.
8 JAN 1998